import { ApiBody } from '@nestjs/swagger'

export const ApiFile = (filename = 'file') => (
  target: any,
  propertyKey: string,
  descriptor: PropertyDescriptor
) => {
  ApiBody({
    schema: {
      type: 'object',
      properties: {
        [filename]: {
          type: 'string',
          format: 'binary'
        }
      }
    }
  })(target, propertyKey, descriptor)
}
